package com.dahai.controller;

import com.dahai.filter.CharsetFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.Filter;
import java.util.HashMap;
import java.util.Map;
@Controller
public class DahaiController {

    @Value("${alibaba.name}")
    private String name;

    @Autowired
    private CharsetFilter charsetFilter;

    @RequestMapping("/test")
    @ResponseBody
    public Map save (){

        System.out.println("测试 方法name:"+name);

        Map<String, Object> map = new HashMap<>();
        map.put("name", "wangjian");
        map.put("age", 26);
        return map;
    }
}
